<?php
//signcheck(array($appid, $pt, $imei));
$goods_id = $_REQUEST['goods_id'];
$place = $_REQUEST['place'];
if ($place == '12' || $place == '11') {
    record_img($goods_id,$place,1,$appid);
} else {
    $sql = "select count(*) as a from tttj.click_goods where goods_id = $goods_id";
    $count = getonerecord($sql);
    if ($count['a'] == '3') {
        $sql = "delete from tttj.click_goods where goods_id = $goods_id";
        $re = getonerecord($sql);
        $sql = "update tttj.time_limit_stock set stock=stock-1 where goods_id=$goods_id";
        $re = getonerecord($sql);
    } else {
        $sql = "insert into tttj.click_goods (`goods_id`) VALUE ($goods_id)";
        $re = getonerecord($sql);
    }
    record_goods($goods_id, $place, 1);
}
echo echojson('success','1','');exit;
?>